/**
 * Created By 李柏霖
 * 2024/1/13 23:01
 */

package springtransactionaldemo.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import springtransactionaldemo.demo.pojo.User;
import springtransactionaldemo.demo.service.IUserService;

import java.util.List;

@Controller
public class UserController {

    @Autowired
    private IUserService userService;

    @GetMapping("/getAllUsers")
    @ResponseBody
    public List<User> getAllUsers() {
        List<User> users = userService.selectAllUsers();
        System.out.println(users);
        return users;
    }
}
